package com.chen.staffjoy.commonlib.validation;

import javax.validation.Constraint;
import java.lang.annotation.*;

/**
 * 自定义手机号校验注解
 * @author Chentian
 */
@Documented
@Constraint(validatedBy = PhoneNumberValidator.class)
@Target({ElementType.FIELD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
public @interface PhoneNumber {
    // 默认错误消息
    String message() default "Invalid phone number";
    // 分组
    Class[] groups() default {};
    // 负载
    Class[] payload() default {};
}
